/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#include "M2SkeletonLoader.h"

#include "M2SkeletonLoadImpl.h"
#include "OgreAnimation.h"

namespace PQGameCore
{
	M2SkeletonLoader::M2SkeletonLoader(std::string path)
		: _path(path)
	{

	}

	M2SkeletonLoader::~M2SkeletonLoader()
	{
	}

	void M2SkeletonLoader::loadResource(Ogre::Resource *resource)
	{
		assert(resource);

		Ogre::Animation::setDefaultInterpolationMode(Ogre::Animation::IM_LINEAR);
		Ogre::Animation::setDefaultRotationInterpolationMode(Ogre::Animation::RIM_LINEAR);

		M2SkeletonLoadImpl impl(static_cast<Ogre::Skeleton*>(resource));
		impl.load(_path);
		
	}
}
